package com.dynamixsoftware.printershare.smb.ntlmssp;

import com.dynamixsoftware.printershare.smb.netbios.NbtAddress;
import com.dynamixsoftware.printershare.smb.util.Dumper;
import java.net.UnknownHostException;

public class Type1Message
  extends NtlmMessage
{
  private static final String DEFAULT_DOMAIN;
  private static final int DEFAULT_FLAGS = 513;
  private static final String DEFAULT_WORKSTATION;
  private String suppliedDomain;
  private String suppliedWorkstation;
  
  static
  {
    DEFAULT_DOMAIN = null;
    try
    {
      String str2 = NbtAddress.getLocalHost().getHostName();
      str1 = str2;
    }
    catch (UnknownHostException localUnknownHostException)
    {
      for (;;)
      {
        String str1 = null;
      }
    }
    DEFAULT_WORKSTATION = str1;
  }
  
  public Type1Message()
  {
    this(getDefaultFlags(), getDefaultDomain(), getDefaultWorkstation());
  }
  
  public Type1Message(int paramInt, String paramString1, String paramString2)
  {
    setFlags(paramInt | getDefaultFlags());
    setSuppliedDomain(paramString1);
    if (paramString2 == null) {
      paramString2 = getDefaultWorkstation();
    }
    setSuppliedWorkstation(paramString2);
  }
  
  private static String getDefaultDomain()
  {
    return DEFAULT_DOMAIN;
  }
  
  private static int getDefaultFlags()
  {
    return DEFAULT_FLAGS;
  }
  
  public static String getDefaultWorkstation()
  {
    return DEFAULT_WORKSTATION;
  }
  
  public String getSuppliedDomain()
  {
    return this.suppliedDomain;
  }
  
  public String getSuppliedWorkstation()
  {
    return this.suppliedWorkstation;
  }
  
  public void setSuppliedDomain(String paramString)
  {
    this.suppliedDomain = paramString;
  }
  
  public void setSuppliedWorkstation(String paramString)
  {
    this.suppliedWorkstation = paramString;
  }
  
  /* Error */
  public byte[] toByteArray()
  {
    // Byte code:
    //   0: bipush 16
    //   2: istore_1
    //   3: aload_0
    //   4: invokevirtual 74	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:getSuppliedDomain	()Ljava/lang/String;
    //   7: astore_3
    //   8: aload_0
    //   9: invokevirtual 76	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:getSuppliedWorkstation	()Ljava/lang/String;
    //   12: astore 4
    //   14: aload_0
    //   15: invokevirtual 77	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:getFlags	()I
    //   18: istore 5
    //   20: iconst_0
    //   21: newarray byte
    //   23: astore 6
    //   25: aload_3
    //   26: ifnull +159 -> 185
    //   29: aload_3
    //   30: invokevirtual 82	java/lang/String:length	()I
    //   33: ifeq +152 -> 185
    //   36: iconst_1
    //   37: istore 7
    //   39: iload 5
    //   41: sipush 4096
    //   44: ior
    //   45: istore 8
    //   47: aload_3
    //   48: invokevirtual 85	java/lang/String:toUpperCase	()Ljava/lang/String;
    //   51: invokestatic 88	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:getOEMEncoding	()Ljava/lang/String;
    //   54: invokevirtual 92	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   57: astore 6
    //   59: iconst_0
    //   60: newarray byte
    //   62: astore 9
    //   64: aload 4
    //   66: ifnull +133 -> 199
    //   69: aload 4
    //   71: invokevirtual 82	java/lang/String:length	()I
    //   74: ifeq +125 -> 199
    //   77: iconst_1
    //   78: istore 7
    //   80: iload 8
    //   82: sipush 8192
    //   85: ior
    //   86: istore 10
    //   88: aload 4
    //   90: invokevirtual 85	java/lang/String:toUpperCase	()Ljava/lang/String;
    //   93: invokestatic 88	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:getOEMEncoding	()Ljava/lang/String;
    //   96: invokevirtual 92	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   99: astore 9
    //   101: iload 7
    //   103: ifeq +14 -> 117
    //   106: bipush 32
    //   108: aload 6
    //   110: arraylength
    //   111: iadd
    //   112: aload 9
    //   114: arraylength
    //   115: iadd
    //   116: istore_1
    //   117: iload_1
    //   118: newarray byte
    //   120: astore 11
    //   122: getstatic 96	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:NTLMSSP_SIGNATURE	[B
    //   125: iconst_0
    //   126: aload 11
    //   128: iconst_0
    //   129: bipush 8
    //   131: invokestatic 102	java/lang/System:arraycopy	(Ljava/lang/Object;ILjava/lang/Object;II)V
    //   134: aload 11
    //   136: bipush 8
    //   138: iconst_1
    //   139: invokestatic 106	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:writeULong	([BII)V
    //   142: aload 11
    //   144: bipush 12
    //   146: iload 10
    //   148: invokestatic 106	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:writeULong	([BII)V
    //   151: iload 7
    //   153: ifeq +29 -> 182
    //   156: aload 11
    //   158: bipush 16
    //   160: bipush 32
    //   162: aload 6
    //   164: invokestatic 110	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:writeSecurityBuffer	([BII[B)V
    //   167: aload 11
    //   169: bipush 24
    //   171: bipush 32
    //   173: aload 6
    //   175: arraylength
    //   176: iadd
    //   177: aload 9
    //   179: invokestatic 110	com/dynamixsoftware/printershare/smb/ntlmssp/Type1Message:writeSecurityBuffer	([BII[B)V
    //   182: aload 11
    //   184: areturn
    //   185: iload 5
    //   187: sipush -4097
    //   190: iand
    //   191: istore 8
    //   193: iconst_0
    //   194: istore 7
    //   196: goto -137 -> 59
    //   199: iload 8
    //   201: sipush -8193
    //   204: iand
    //   205: istore 10
    //   207: goto -106 -> 101
    //   210: astore_2
    //   211: new 112	java/lang/IllegalStateException
    //   214: dup
    //   215: aload_2
    //   216: invokevirtual 115	java/io/IOException:getMessage	()Ljava/lang/String;
    //   219: invokespecial 117	java/lang/IllegalStateException:<init>	(Ljava/lang/String;)V
    //   222: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	223	0	this	Type1Message
    //   2	116	1	i	int
    //   210	6	2	localIOException	java.io.IOException
    //   7	41	3	str1	String
    //   12	77	4	str2	String
    //   18	173	5	j	int
    //   23	151	6	arrayOfByte1	byte[]
    //   37	158	7	k	int
    //   45	160	8	m	int
    //   62	116	9	arrayOfByte2	byte[]
    //   86	120	10	n	int
    //   120	63	11	arrayOfByte3	byte[]
    // Exception table:
    //   from	to	target	type
    //   3	25	210	java/io/IOException
    //   29	36	210	java/io/IOException
    //   47	59	210	java/io/IOException
    //   59	64	210	java/io/IOException
    //   69	77	210	java/io/IOException
    //   88	101	210	java/io/IOException
    //   106	117	210	java/io/IOException
    //   117	151	210	java/io/IOException
    //   156	182	210	java/io/IOException
  }
  
  public String toString()
  {
    String str1 = getSuppliedDomain();
    String str2 = getSuppliedWorkstation();
    StringBuilder localStringBuilder1 = new StringBuilder().append("Type1Message[suppliedDomain=");
    if (str1 == null) {
      str1 = "null";
    }
    StringBuilder localStringBuilder2 = localStringBuilder1.append(str1).append(",suppliedWorkstation=");
    if (str2 == null) {
      str2 = "null";
    }
    return str2 + ",flags=0x" + Dumper.toHexString(getFlags(), 8) + "]";
  }
}


/* Location:           C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar.jar
 * Qualified Name:     com.dynamixsoftware.printershare.smb.ntlmssp.Type1Message
 * JD-Core Version:    0.7.0.1
 */